<html>
	<head>
		<meta charset="UTF-8">
		<title>
			CWHES欢迎你！
		</title>
				<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js">
		</script>
		<link href="https://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css"
		rel="stylesheet">
		<script src="https://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js">
		</script>
		<script src="https://cdn.bootcss.com/Chart.js/2.6.0/Chart.bundle.min.js"></script>
		<!--[if lt IE 10]>
			<script src="https://cdn.bootcss.com/html5shiv/r29/html5.js"></script>
		<![endif]-->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<style type="text/css">
			body {
				font-family: "微软雅黑","Microsoft YaHei";
				background:#FFFFFF;
				-moz-user-select: none;
				-webkit-user-select: none;
				user-select: none;
			}
		</style>
		<script>
		$(document).ready(function(){
			$("span#reg-error").text('因为这是群内评估系统');
			$("div#reg-error").append('所以请务必加群<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=4b4d09fd759080a0117876a839e9a58bf1925bfce37b2a392c53075b8a2fcb1f">578868904</a>');
			$("div#reg-error").show();
			$("span#reg-head").append('<a href="./index.php">点我注册</a>');
			$("div#reg-head").show();
			$("form").submit(function() {
				$.post("./users.php",{
					"send":"login",
					"username":$("#username").val(),
					"password":$("#password").val(),
					"qq":"1"
				},function(data) {
					if(data['code'] == '200'){
						$("form").remove();
						$("#reg-head").text("登录成功！");
						$("#reg-head").append("即将跳转！");
						window.setTimeout("window.location='main.php'",3000); 
						$("#reg-head").show();
					}else if(data['code'] == '300'){
						$("#reg-head").text("密码或用户名不能为空！");
						$("#reg-head").show();
					}else if(data['code'] == '400'){
						$("#reg-head").text("填写不符合要求！");
						$("#reg-head").show();
					}else if(data['code'] == '500'){
						$("#reg-head").text("账号不存在！");
						$("#reg-head").show();
					}else if(data['code'] == '600'){
						$("#reg-head").text("密码不正确！");
						$("#reg-head").show();
					}
				},"json");
			});
		});
		</script>
	</head>
	<body>
		<div class="container bs-docs-container">
			<div class="row">
				<div class="panel panel-primary" style="margin:1% 1% 1% 1%;">
					<div class="panel-heading">
						<h3 class="panel-title">
							CWHES登录
						</h3>
					</div>
					<div id="bd" style="margin:0% 5% 5% 5%;">
						<br/>
						<div id="reg-error" class="alert alert-warning" style="display: none">
							<span id="reg-error"></span>
						</div>
						<div id="reg-head" class="alert alert-success" style="display: none">
							<span id="reg-head"></span>
						</div>
						<form onsubmit="return false;">
							<div class="input-group">
								<span id="tx" class="input-group-addon">
								用户名
								</span>
								<input required type="text" class="form-control" id="username" placeholder="你的用户名(只能为字母和数字)" style="width:100%">
							</div>
							<br />
							<div class="input-group">
								<span id="tx" class="input-group-addon">
								密码
								</span>
								<input required type="text" class="form-control" id="password" placeholder="你的账号密码(只能为字母和数字)" style="width:100%">
							</div>
							<div class="login-button">
								<br />
								<button type="submit" class="btn btn-primary" style="width:100%;float:left;">登录</button>
							</div>
						</form>
						<br>
						<br>
						<br>
						<div class="panel panel-success" style="margin:1% 1% 1% 1%;"><div class="panel-heading">
							<h3 class="panel-title">
								公告
							</h3>
						</div>
    							<div id="bd" style="margin:0% 5% 5% 5%;">
								<br>
								<br>
								目前没有任何公告~~<br>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</body>
</html>